package com.seselin.adapter;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import java.util.ArrayList;

public class ViewListAdapter extends BaseAdapter {

    private ArrayList<View> viewList = new ArrayList<>();

    public ArrayList<View> getViewList() {
        return viewList;
    }

    public void setViewList(ArrayList<View> viewList) {
        this.viewList = viewList;
    }

    @Override
    public int getCount() {
        return viewList.size();
    }

    @Override
    public Object getItem(int i) {
        return viewList.get(i);
    }

    @Override
    public long getItemId(int position) {
        return (long) position;
    }

    @Override
    public int getItemViewType(int position) {
        return position;
    }

    @Override
    public View getView(int position, View view, ViewGroup parent) {
        int viewType = getItemViewType(position);
        view = viewList.get(viewType);
        return view;
    }

}
